package org.csmzxy.class2333;
//部门类 抽象类
abstract class Department{
    String name;
    int numOfMembers;
    //抽象方法无方法体
    public abstract void work();
}
//技术部门类
class TechDepartment extends Department{
    //有参构造方法
    public TechDepartment(String name,int numOfMembers){
        super.name = name;
        super.numOfMembers = numOfMembers;
    }

    @Override
    public void work() {
        System.out.println(super.name+"负责技术研发、软件开发和系统维护等，"+"部门有"+super.numOfMembers+"人。");
    }
}
//销售部门类
class SaleDepartment extends Department{
    //先写有参构造方法，返回值
    public SaleDepartment(String name,int numOfMembers){
        super.name = name;
        super.numOfMembers = numOfMembers;
    }
    //在报错处Alt+Enter.将父类中所有的抽象方法重写
    @Override
    public void work() {
        System.out.println(super.name + "负责销售业务扩展、市场营销策划等，"+"部门有"+super.numOfMembers+"人。");
    }

}
public class Example09 {
    public static void main(String[]args){
        TechDepartment t = new TechDepartment("技术部门",50);
        t.work();
        SaleDepartment s =new SaleDepartment("销售部门",30);
        s.work();
    }
}
